/**
 * Created by meiyun1 on 2017/8/11.
 */
import Vue from 'vue'
import params from '../conf/params'
import { clearEmptyValue } from '../utils/common'

export default {
  getSchemeList (search) {
    clearEmptyValue(search)
    return Vue.http.get(`${params.base_url}/schemes`, {params: search})
  },
  addScheme (news) {
    return Vue.http.post(`${params.base_url}/scheme`, news)
  },
  updateScheme (id, scheme) {
    return Vue.http.put(`${params.base_url}/scheme/${id}`, scheme)
  },
  getSchemeById (id) {
    return Vue.http.get(`${params.base_url}/scheme/${id}`)
  },
  deleteScheme (ids) {
    return Vue.http.delete(`${params.base_url}/scheme/${ids}`)
  }
}
